const mongoose = require("mongoose");

const FacilitySchema = new mongoose.Schema({
  name: { type: String, required: true },
  status: { type: Number, default: 200, required: true },
  type: { type: String },
  lon: { type: Number, required: true },
  lat: { type: Number, required: true },
  logs: [{type: mongoose.Schema.Types.ObjectId, ref: 'Log'}]
})

const Facility = mongoose.model('Facility', FacilitySchema, 'facility')

module.exports = Facility
